<?php

Prado::using('System.Web.UI.WebControls.TImage');

class TOpenIdLogo extends TImage
{
	const OIDLogo_small			= 'openid-logo-small.png';
	const OIDLogo_normal		= 'openid-logo.png';
	const OIDLogoType_small		= 'small';
	const OIDLogoType_normal	= 'normal';

	private $_publishedAssetsUrl;
	//
	// We need to publish the OpenId logo
	public function onPreRender($param)
	{
		$path		= PortalUtil::PathName(Prado::getPathOfNamespace('Application.Common.3rdParty.OpenId.assets'));
        //$publish	= $path . self::OpenIdLogo;
		$this->_publishedAssetsUrl = Prado::getApplication()->getAssetManager()->publishFilePath($path);
		if(strtolower($this->LogoType) == self::OIDLogoType_small)
			$this->ImageUrl = $this->_publishedAssetsUrl . '/' . self::OIDLogo_small;
		else if(strtolower($this->LogoType) == self::OIDLogoType_normal)
			$this->ImageUrl = $this->_publishedAssetsUrl . '/' . self::OIDLogo_normal;
	}

	public function getLogoType()
	{
		return $this->getViewState('LogoType',self::OIDLogo_small);
	}

	public function setLogoType($value)
	{
		return $this->setViewState('LogoType',$value,self::OIDLogo_small);
	}
}
?>